package org.boulderfoodrescue.webapp.shared;

import java.io.Serializable;
import java.util.Date;

import org.boulderfoodrescue.webapp.shared.Location.FoodType;

public class PickupReport implements Serializable{
	private static final long serialVersionUID = -4628638236595487574L;

	private Long databaseKey;

	private Long pickupKey;
	private Long pickupIndex;

	private Date pickupDate;

	private Double weight;

	private FoodType foodType;

	private Long donorKey;
	private Location donor;

	private Long recipientKey;
	private Location recipient;

	private String itemDiscription;
	private String notes;

	private Long volunteerKey;
	private UserAccountDetails volunteer;

	private TransportationType transportationType;

	public Long getDatabaseKey() {
		return databaseKey;
	}

	public void setDatabaseKey(Long databaseKey) {
		this.databaseKey = databaseKey;
	}

	public Long getPickupKey() {
		return pickupKey;
	}

	public void setPickupKey(Long pickupKey) {
		this.pickupKey = pickupKey;
	}

	public Long getPickupIndex() {
		return pickupIndex;
	}

	public void setPickupIndex(Long pickupIndex) {
		this.pickupIndex = pickupIndex;
	}

	public Date getPickupDate() {
		return pickupDate;
	}

	public void setPickupDate(Date pickupDate) {
		this.pickupDate = pickupDate;
	}

	public Double getWeight() {
		return weight;
	}

	public void setWeight(Double weight) {
		this.weight = weight;
	}

	public FoodType getFoodType() {
		return foodType;
	}

	public void setFoodType(FoodType foodType) {
		this.foodType = foodType;
	}

	public Long getDonorKey() {
		return donorKey;
	}

	public void setDonorKey(Long donorKey) {
		this.donorKey = donorKey;
	}

	public Location getDonor() {
		return donor;
	}

	public void setDonor(Location donor) {
		this.donor = donor;
	}

	public Long getRecipientKey() {
		return recipientKey;
	}

	public void setRecipientKey(Long recipientKey) {
		this.recipientKey = recipientKey;
	}

	public Location getRecipient() {
		return recipient;
	}

	public void setRecipient(Location recipient) {
		this.recipient = recipient;
	}

	public String getItemDiscription() {
		return itemDiscription;
	}

	public void setItemDiscription(String itemDiscription) {
		this.itemDiscription = itemDiscription;
	}

	public String getNotes() {
		return notes;
	}

	public void setNotes(String notes) {
		this.notes = notes;
	}

	public Long getVolunteerKey() {
		return volunteerKey;
	}

	public void setVolunteerKey(Long volunteerKey) {
		this.volunteerKey = volunteerKey;
	}

	public UserAccountDetails getVolunteer() {
		return volunteer;
	}

	public void setVolunteer(UserAccountDetails volunteer) {
		this.volunteer = volunteer;
	}

	public TransportationType getTransportationType() {
		return transportationType;
	}

	public void setTransportationType(TransportationType transportationType) {
		this.transportationType = transportationType;
	}


	public Long getFoodTypeAsLong()
	{
		switch(foodType)
		{
		case Produce: return 0l;
		case PreparedFood: return 1l;
		case BakedGoods: return 2l;
		default: return -1l;
		}
	}
	public void setFoodTypeViaLong(Long foodType)
	{
		switch(foodType.intValue())
		{
		case 0: this.foodType = FoodType.Produce;break;
		case 1: this.foodType = FoodType.PreparedFood; break;
		case 2: this.foodType = FoodType.BakedGoods; break;
		}
	}
	public Long getTransportationAsLong() {
		switch(transportationType)
		{
		case Bike: return 0l;
		case Car: return 1l;
		case Walking: return 2l;
		case Other: return 3l;
		}
		return 0l;
	}

	public void setTransportationViaLong(Long transportation) {
		switch(transportation.intValue())
		{
		case 0: this.transportationType = TransportationType.Bike;break;
		case 1: this.transportationType = TransportationType.Car;break;
		case 2: this.transportationType = TransportationType.Walking; break;
		case 3: this.transportationType = TransportationType.Other; break;
		}
	}
}
